#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QGridLayout>
#include "global_variable.h"
#include "Gas_Set/gascontent_menu.h"
#include "softkeyboard.h"
#include "Instrument_ctrl/instrumrnt_menu.h"
#include "Instrument_ctrl/lookrecord_date.h"
#include "Instrument_ctrl/showdata.h"
#include "init_show.h"
#include "O3_Set/set_o3_photo.h"
#include "Diagnosis/diagnosis_menu.h"
#include "Warn/warning_menu.h"
#include "Maintain/maintain_menu.h"
#include "Maintain/maintain_menu2.h"
#include "init_message.h"
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void ui_Init();
    float PID1_realize(float temp);
    void PID1_init(void);
    void Warn_cnt();
    int pos=0;
    int totalBtn =8;
    QTimer  *timer;
    QTimer *timer_CreateFile;
    QTimer  *timer2;
     QTimer *timer_wel;
     QTimer *timer_flow;
     QTimer *timer_flow2;
     QTimer *timer_flow3;
     QTimer *timer_flow4;
     QTimer *timer_m_time;//自动进行项目的计时器
     QTimer *timer_tb;
     QTimer *timer_file;
     QTimer *timer_warncnt;
     QTimer *timer_photo;//光度计数据的平均

     void time_Init();
    QList <QPushButton * >btnlist_ui;
    QLabel* theLabel[10];
    bool eventFilter(QObject *watched, QEvent *event);
    void data_Record();
    void data_recordInit();
    void  WriteToFile();
    QString data_collect();
    void mkdirdatefile();
    void test_srf(QString text);
  static  bool DeleteFileOrFolder(const QString &strPath);
    QStringList GetDirNameList(const QString &strDirpath);
    void delexpiredfile(const QString &strDirpath);
    void init_data();
    bool  Main_show_flag=1;
    QString name;
    float PPPPP;
    float Ozo_Ppm=0;          //显示的臭氧浓度                //因为Sysctrl->Show_Ozo容易被改写成0，导致数据错乱，所以在计算完以后马上保存到Ozo_Ppm
    float Ozo_Ppm_2=0;          //显示的臭氧浓度                //因为Sysctrl->Show_Ozo容易被改写成0，导致数据错乱，所以在计算完以后马上保存到Ozo_Ppm
    float Con_O[8] ;
    QString data_nd;
    float Ozo_Ppm_aver_con=0;       //当前值
    float temp_K =1;
    bool temp_K_Flag =0;
    int flow_z;
    int flow_g;
    int temp=0;
    QString cycletime[7]={"停止记录","1","5","10","15","30","60"};
    int aver_cnt=0;
    int file_cnt=0;
    bool flag_WriteToH_M;
    bool first_start = 0;
    bool first_start_H = 0;
    int cnt_ToWrite=0;
    int cnt_ToWriteH=0;
    int WriteTimes = 6;//默认1min写入一次文件
    int min_write;//记录写入时的分钟
};

#endif // MAINWINDOW_H
